import { http } from '@/utils/http'
import { GoodsRelevantItem, GoodsResult } from '@/types/goods'

// 获取商品详情数据
export const getGoodsData = (id: string) => {
  return http<GoodsResult>({
    url: '/goods',
    data: {
      id
    }
  })
}

// 同类推荐(也支持猜你喜欢)
export const getGoodsRelevantData = (data: { id?: string; limit?: number }) => {
  return http<GoodsRelevantItem[]>({
    url: '/goods/relevant',
    data
  })
}
